import json
from sqlalchemy.orm import Session

from app.models.banner import Banner
from app.schemas.banner import BannerVo


def banner_list(db: Session) -> list[BannerVo]:
    """查询列表"""
    banner_do_list = db.query(Banner).filter(Banner.is_delete == 0).all()
    return [
        BannerVo.model_validate(banner_do) for banner_do in banner_do_list
    ]
